function [] = plot_predicted_timeseries(mypred_vals, mytrue_vals, outputFile, periodLabels, includeLegend, varargin)
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	% This function plots a time series plot with true and predicted values.
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	%%%%% Inputs:
	% mypred_vals:			T x NumPreds
	% mytrue_vals:			T x 1
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	
	mytitle = '';
	if includeLegend
		legendValue = 'northwest';
	else
		legendValue = 'noLegend';
	end
	
	if length(varargin) >= 1
		ylimits = varargin{1};
	else
		ylimits = [];
	end
	
	%%% Compute statistics of predictions (mean and quantiles)
	mypred_mean  = mean(mypred_vals, 2);           % T x 1
%	mypred_pct50 = quantile(mypred_vals', 0.50)';  % T x 1
	mypred_pct25 = quantile(mypred_vals', 0.25)';  % T x 1
	mypred_pct75 = quantile(mypred_vals', 0.75)';  % T x 1
	
	%%% Plot actual vs predictions
	M = table(periodLabels, mytrue_vals, mypred_mean, mypred_pct25, mypred_pct75);
	plotTimeSeries(M, outputFile, mytitle, '', ...
		{'Actual adoptions', 'Predicted adoptions: mean', 'Predicted adoptions: 25% percentile', 'Predicted adoptions: 75% percentile'}, {false false false false}, ...
		{[0.35 0.35 0.35], 'black', 'black', 'black'}, {}, legendValue, ylimits, '', {'-', '--', ':', ':'}, 50, 20, 15);	
end
